--table-array
t1={id=1}

--插入
table.insert(t1,"11")
for i, v in pairs(t1) do
    print(i,"=",v)
end

--指定位置插入
t1={id=1}
table.insert(t1,1,"指定位置插入")
print("指定位置插入")
for i, v in pairs(t1) do
    print(i,"=",v)
end

--concat
t1={"lisi","男"}
print("table.concat(t1)",table.concat(t1))
print("table.concat(t1,',')",table.concat(t1,","))

--移除
t1={"a","b","c"}
table.remove(t1)--最后的数据开始移除
print("remove",table.concat(t1))

table.remove(t1,1)
print("remove",table.concat(t1))

--排序
t1={"b","a","c"}
table.sort(t1)
print("sort",table.concat(t1))

--table构建集合方法体
t={}
t.add=function(val1,val2)
    return val1+val2;
end

t.sub=function(val1,val2)
    return val1-val2
end

print("1+2",t.add(1,2))
print("2-1",t.sub(2,1))
